//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Globalization;
using System.Reflection;
using System.Windows.Data;
using OpenLS.Spreadsheet.Extensibility;

namespace OpenLS.Spreadsheet.UI.Internals
{
    class IsOptionalParameterConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var p = (ParameterInfo)value;
            return p.GetCustomAttributes(typeof(OptionalAttribute), false).Length > 0;

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
